package com.dkhseep.bigevent.controller;

import com.dkhseep.bigevent.pojo.Result;
import com.dkhseep.bigevent.service.FileUploadService;
import com.dkhseep.bigevent.util.AliOssUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;
import java.util.UUID;

/**
 * 功能:
 * 作者:Dksheep
 * 日期:2024/10/1120:15
 */
@RestController
public class FileUploadController {
    @Autowired private FileUploadService fileUploadService;
    @PostMapping("/upload")
    public Result<String> fileUpload(MultipartFile file)throws Exception {
        String url = fileUploadService.upload(file);
        return Result.success(url);
    }
}
